<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>用户管理</title>
	<link rel="stylesheet" href="css/bootstrap.min.css" />
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<style type="text/css">
		#xuexiao{
			color:#555;
		}
		#xuexiao:hover{
			color:#3a87ad;
		}
	</style>
</head>
<body >
		<%@include file="include/topbar.jsp" %>
		
		<div class="container" style="margin-top: 60px">
			<div class="row">
			<jsp:include page="include/left.jsp" >
				<jsp:param value="userco" name="tag"/>
			</jsp:include>
				
			
			<div class="span9" style="min-height:500px">
				<div class="breadcrumb" style="border-radius:3px 3px 0 0;margin-bottom:0px;">
        				<h4 style="display:inline"><i class="icon-cog"></i>成员管理</h4>
        				<span class="pull-right">共计${userlist.size() }位用户</span>
     			</div>
     			<div class="wall" style="padding:20px 30px;min-height:350px">
     				
     				<table class="table table-striped table-bordered table-condensed">
  						<thead>
  							<tr>
  								<th>用户id</th>
  								<th>名字</th>
  								<th>用户密码</th>
  								<th>用户身份</th>
  							</tr>
  						</thead>
  						<tbody>
  							<c:forEach items="${userlist }" var="user">
  								<tr>
  									<td width=40%>${user.id }</td>
  									<td >${user.username }</td>
  									<td>***************</td>
  									<td width=20%>${user.role }
  										<c:if test="${user.role eq 'member' }">
  											<a href="#edit" title="提升权限" data-toggle="modal" ref="${user.id }" ><i class="icon-arrow-up"></i></a>
  											
  											<a href="#del" title="删除用户" data-toggle="modal" rel="${user.id }" ><i class="icon-trash"></i></a>
  											
  										</c:if>
  										
  									</td>
  								</tr>
  							</c:forEach>
  						</tbody>
					</table>
     			</div>
			</div>	
			
			
			</div>
			</div>
			<%@include file="include/footer.jsp" %>
			
											<div class="modal fade" id="edit">
												    <div class="modal-header">
	    												<a class="close" data-dismiss="modal">×</a>
												    <h4>系统提示</h4>
												    </div>
												    <div class="modal-body" style="text-align:center">
												   		<h4>确定要提升此用户的权限么？</h4>
												    </div>
													<div class="modal-footer">
												    <a href="javascript:;" class="btn" data-dismiss="modal">返回</a>
												    <a href="#" class="btn btn-primary" id="btn-edit">确认修改</a>
												    </div>
											</div>
											
											
											
											 <div class="modal fade" id="del">
												   <div class="modal-header">
	    												<a class="close" data-dismiss="modal">×</a>
												    	<h4>系统提示</h4>
												    </div>
												    <div class="modal-body" style="text-align:center">
												   		<h4>确定要删除此用户么？</h4>
												    </div>
													<div class="modal-footer">
												    <a href="javascript:;" class="btn" data-dismiss="modal">返回</a>
												    <a href="#" class="btn btn-primary" id="btn-del">确认删除</a>
												    </div>
											</div>

			<script type="text/javascript">
				 $(document).ready(function(){
					$("a[ref]").click(function(){
						
						var id = $(this).attr("ref");
						$("#btn-edit").attr("href","usercontrol.jspx?m=edit&&uid="+id);
					});
					
					$("a[rel]").click(function(){
						var id = $(this).attr("rel");
						$("#btn-del").attr("href","usercontrol.jspx?m=del&&uid="+id);
					});
				
				}); 
			</script>
	
</body>
</html>